home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’92 / FinderMenu ƒ / FinderMenu INIT ƒ / Patches.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-09-10  |  4.7 KB  |  227 lines  |  [TEXT/KAHL]

  1. /*
  2.  * (C) 1992 SixxHeads Software
  3.  * (C) 1992 Berkeley Systems Inc.
  4.  * 
  5.  * This code is freely distributable, but credit must be given in any
  6.  * derivative work.
  7.  * 
  8.  * <Revision History>
  9.  *        04/28/92 smz Created.
  10.  */
  11.  
  12. #ifndef __PATCHES__
  13. #define __PATCHES__
  14.  
  15. #include <GenericPatch.h>
  16.  
  17. class MenuSelectPatch : public GenericPatch {
  18. public:
  19.     MenuSelectPatch(void);
  20.     virtual void Behavior(void);
  21. };
  22.  
  23. typedef struct {
  24.     Point            itsStartPt;
  25.     unsigned long    itsResult;
  26. } MenuSelectParameters;
  27.  
  28. typedef struct MenuSelectParameters ;
  29. typedef pascal long (*MenuSelectProcPtr) (Point pt);
  30.  
  31. /***************************************************************************/
  32.  
  33. class HiliteMenuPatch : public GenericPatch {
  34. public:
  35.     HiliteMenuPatch(void);
  36.     virtual void Behavior(void);
  37. };
  38.  
  39. typedef pascal void (*HiliteMenuProcPtr)(short menuID);
  40. typedef struct {
  41.     short itsID;
  42.     unsigned long dummy;
  43. } HiliteMenuParms;
  44.  
  45. /***************************************************************************/
  46.  
  47. class SetCursorPatch : public GenericPatch {
  48. public:
  49.     SetCursorPatch(void);
  50.     virtual void Behavior(void);
  51. };
  52.  
  53. typedef struct {
  54.     Cursor *itsCursorPtr;
  55.     unsigned long dummy;
  56. } SetCursorParameters;
  57.  
  58. /***************************************************************************/
  59.  
  60. class MenuKeyPatch : public GenericPatch {
  61. public:
  62.     MenuKeyPatch(void);
  63.     virtual void Behavior(void);
  64. };
  65.  
  66. typedef struct {
  67.     char            padding;
  68.     char            itsKey;
  69.     unsigned long    itsResult;
  70. } MenuKeyParameters;
  71.  
  72. typedef pascal long (*MenuKeyProcPtr)(short key);
  73.  
  74. /***************************************************************************/
  75.  
  76. class DrawMenuBarPatch : public GenericPatch {
  77. public:
  78.     DrawMenuBarPatch(void);
  79.     virtual void Behavior(void);
  80. };
  81.  
  82. typedef pascal void (*DrawMenuBarProcPtr)(void);
  83.  
  84. /***************************************************************************/
  85.  
  86. class SystemTaskPatch : public GenericPatch {
  87. public:
  88.     SystemTaskPatch(void);
  89.     virtual void Behavior(void);
  90. };
  91.  
  92. /***************************************************************************/
  93.  
  94. class FSDispatchPatch : public GenericPatch {
  95. public:
  96.     FSDispatchPatch(void);
  97.     virtual void Behavior(void);
  98. };
  99.  
  100. typedef pascal void (*FSDispatchProcPtr)(void);
  101.  
  102. /***************************************************************************/
  103.  
  104. class AlertPatch : public GenericPatch {
  105. public:
  106.     AlertPatch(void);
  107.     virtual void Behavior(void);
  108. };
  109.  
  110. typedef struct {
  111.     long    itsProc;
  112.     short    itsID;
  113.     short    itsResult;
  114. } AlertPatchParameters;
  115.  
  116. /***************************************************************************/
  117.  
  118. class NewWindowPatch : public GenericPatch {
  119. public:
  120.     NewWindowPatch(void);
  121.     virtual void Behavior(void);
  122. };
  123.  
  124. class NewCWindowPatch : public GenericPatch {
  125. public:
  126.     NewCWindowPatch(void);
  127.     virtual void Behavior(void);
  128. };
  129.  
  130. typedef struct {
  131.     long        itsRefCon;
  132.     Boolean        itsGoAwayFlag;
  133.     WindowPtr    itsBehind;
  134.     short        itsDefProc;
  135.     Boolean        itsVisible;
  136.     char         *itsTitle;
  137.     Rect        *itsBounds;
  138.     Ptr            itsStorage;
  139.     void        *itsResult;
  140. } NewWindowParameters;
  141.  
  142. /***************************************************************************/
  143.  
  144. /* 
  145.  * DrawString 
  146.  */
  147. class DrawStringPatch : public GenericPatch {
  148. public:
  149.     DrawStringPatch(void);
  150.     virtual void Behavior(void);
  151. };
  152.  
  153. typedef struct {
  154.     unsigned char *itsString;
  155.     unsigned long bogusResult;    /* for offsetOf */
  156. } DrawStringParameters;
  157.  
  158. typedef pascal void (*DrawStringProcPtr)(Str255 s);
  159.  
  160. /***************************************************************************/
  161.  
  162. class StringWidthPatch : public GenericPatch {
  163. public:
  164.     StringWidthPatch(void);
  165.     virtual void Behavior(void);
  166. };
  167.  
  168. typedef struct {
  169.     unsigned char *itsString;
  170.     short itsResult;
  171. } StringWidthParameters;
  172.  
  173. /***************************************************************************/
  174.  
  175. class InsertMenuPatch : public GenericPatch {
  176. public:
  177.     InsertMenuPatch(void);
  178.     virtual void Behavior(void);
  179. };
  180.  
  181. typedef struct {
  182.     short            itsBeforeID;
  183.     MenuHandle        itsMenuHandle;
  184.     unsigned long     dummy;    /* for offsetOf */
  185. } InsertMenuParameters;
  186.  
  187. /***************************************************************************/
  188.  
  189. class DeleteMenuPatch : public GenericPatch {
  190. public:
  191.     DeleteMenuPatch(void);
  192.     virtual void Behavior(void);
  193. };
  194.  
  195. typedef struct {
  196.     short            itsID;
  197.     unsigned long     dummy;    /* for offsetOf */
  198. } DeleteMenuParameters;
  199.  
  200. /***************************************************************************/
  201.  
  202. class PostEventPatch : public GenericPatch {
  203. public:
  204.     PostEventPatch(void);
  205.     void Behavior(void);
  206. };
  207.  
  208. /***************************************************************************/
  209.  
  210. class ParamTextPatch : public GenericPatch {
  211. public:
  212.     ParamTextPatch(void);
  213.     void Behavior(void);
  214. };
  215.  
  216. typedef pascal void (*ParamTextProcPtr)(char *s1, char *s2, char *s3, char *s4);
  217.  
  218. typedef struct {
  219.     char            *itsS1;
  220.     char            *itsS2;
  221.     char            *itsS3;
  222.     char            *itsS4;
  223.     unsigned long     dummy;
  224. } ParamTextParameters;
  225.  
  226. #endif __PATCHES__
  227.